<%@ page import="org.ttjhome.html.struts.candidate.Constants"%>
<%@ include file="/WEB-INF/jspf/tag-libraries.jspf" %>
<tiles:importAttribute/>

<%--
	Displays the error icon and the list of errors from the InputFieldRegistry.INPUT_ERRORS collection. NOTE: this is
	 similar to pageHeaderError.jsp (errors-page-header) but displays the list of messages BELOW the error icon.

	Prerequisite:  ActionMessages object should be set in request scope as "Constants.ACTION_MESSAGES".
	The page level error, such as 'Oops, something is wrong' should have the key "pageerror".
	All input messages such be under the key "errors" for iteration.
	Prerequisite:  set the name of the error style sheet class in scope, such as
		&lt;tiles:put name="errorStyle" value="err-msg"/&gt;
	Prerequisite:  Resource bundle set in request scope with bundle name="errorBundle"
		NOTE: this must be of type 'ActionMessages' - use <ttjhome:resource> not <ttjhome:bundle>
	Prerequisite:  Stylesheet should be in already in the header with classes "clear" and "clear10"

	Optional: &lt;tiles:put name="errorIcon" value="../include/img/error-sign.gif"/&gt;
		- will use this image for the error icon.
--%>

<logic:messagesPresent name="<%= Constants.ACTION_MESSAGES %>">
	<div id="${errorStyle}" class="err-msg">
		<c:choose>
			<c:when test="${errorIcon != null}">
				<span class="inl" ><img src="${errorIcon}" alt="" /></span>
			</c:when>
			<c:otherwise>
				<span class="inl" ><img src="../include/img/error-sign.gif" alt="" /></span>
			</c:otherwise>
		</c:choose>

		<div class="text inl">
			<html:messages name="<%= Constants.ACTION_MESSAGES %>" id="message" bundle="errorBundle" property="pageerror">
				${message}<br/>
			</html:messages>
			<%--<div class="clear"></div>--%>
		</div>

		<ul>
			<html:messages name="<%= Constants.ACTION_MESSAGES %>" id="message" bundle="errorBundle" property="errors">
				<li>${message}</li>
			</html:messages>
		</ul>

		<br clear="all" />
	</div><div class="clear10"></div>
</logic:messagesPresent>